#ifndef THREAD_HPP
#define	THREAD_HPP
#include "runnable.hpp"
#include <WinBase.h>
#include <process.h>

namespace com_oocl_monitor {
	namespace system {
		struct PM {
			Runnable *_run;
			HANDLE *_sem;
			PM(Runnable *run, HANDLE *sem) :_run(run), _sem(sem) {}
			~PM() {
				_run = nullptr;
				_sem = nullptr;
			}
		};
		class Thread {
		public:
			explicit Thread(Runnable *run, HANDLE *sem = nullptr) :_run(run), _sem(sem) {
			}
			~Thread() {
			}
			void run();
		private:
			static unsigned int __stdcall threadFun(LPVOID pM);
			Runnable *_run;
			HANDLE *_sem;
		};
	}
}




#endif	/* THREAD_HPP */

